package com.spotbook.providers;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class SpotHelper extends SQLiteOpenHelper {

	public SpotHelper(Context context) {
		super(context, Contract.FILE, null, Contract.VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE " + Contract.TABLE + "(" + Contract._ID
				+ " INTEGER PRIMARY KEY, " + Contract._NAME + " TEXT, "
				+ Contract._SUMMARY + " TEXT, " + Contract._LATITUDE
				+ " REAL, " + Contract._LONGITUDE + " REAL, "
				+ Contract._THUMBNAIL + " BLOB)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE " + Contract.TABLE);
	}
}
